var vm = new Vue({
    el: '#index',
    data () {
        
        return {
          host,
          username:'',
          category_list:[],
        }
      },
    mounted(){
        let user = localStorage.username;    
        
        this.username = user;
        
        this.fnGetCategories();

      },
    methods:{
        fnQuit:function(){
           sessionStorage.clear();
           localStorage.clear();
        //    this.$router.push({path:'/'});
           location.href = 'index.html';

        },
        fnGetCategories(){
          let token = localStorage.token;
          axios.get(this.host + '/goods/categories/', 
          {
            // headers: {
            //   'Authorization': 'JWT ' + token
            // },
            responseType: 'json',
          })
          .then(dat=>{
              this.category_list = dat.data;        
          }).catch(err=>{      
             console.log(err.response);
          });
        },

        goodslist:function(id){
          location.href = 'Product_List.html?categorie_id='+id;
          // this.$router.push({path:'/single-product.html',query:{sku_id:id}});


        },
       
    }
});